package pl.smath.expression.model.presentation;

import pl.smath.expression.model.Term;

public class ConjugateTerm extends PresentationTerm {

	private Term innerTerm;
	
	public ConjugateTerm(Term innerTerm) {
		super("*");
		this.innerTerm = innerTerm;
	}
	
	public Term getInnerTerm() {
		return innerTerm;
	}

	/**
	 * Sprawdzenie czy 2 wartości bezwgledne wyrazenia sa sobie równowazne.
	 */
	public boolean isAbsTheSame(Term term){
		if (!(term instanceof ConjugateTerm))
			return false;
		
		return innerTerm.isAbsTheSame(((ConjugateTerm)term).getInnerTerm());
	}
	
	public String toString(){
		return innerTerm.toString() + "*";
	}

}
